Skip to content

updated to reflect changes around event aggregation#800

Open
dmitri-netbird wants to merge 3 commits into
mainfrom
dmitri-event-aggregation
Open

updated to reflect changes around event aggregation#800
dmitri-netbird wants to merge 3 commits into
mainfrom
dmitri-event-aggregation

Conversation

@dmitri-netbird

@dmitri-netbird dmitri-netbird commented Jun 17, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Documentation
    • Enhanced documentation for traffic events with improved descriptions of event aggregation and correlation mechanisms.
    • Added Event Grouping section explaining how events are grouped per protocol, destination address/port over 5-minute time windows.
    • Updated API response schema with new time-window markers and per-group event count metrics.

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates traffic-events-logging.mdx to reflect a grouped-window traffic event model. Adds an "Event Grouping" subsection, replaces per-flow timestamp/type fields with WindowStart, WindowEnd, NumOfStarts, NumOfEnds, and NumOfDrops, and updates the API sample JSON to match.

Changes

Traffic Events Grouped-Window Model Documentation

Layer / File(s) Summary
Aggregation terminology and Event Grouping subsection
src/pages/manage/activity/traffic-events-logging.mdx
Rephrases the event correlation sentence to use "aggregating" and adds a new "Event Grouping" subsection defining grouping by protocol, destination address/port, and ICMP type over a 5-minute interval.
Field reference and API sample update
src/pages/manage/activity/traffic-events-logging.mdx
Replaces per-flow fields (timestamp, type, ICMP code+type) with grouped-window fields (WindowStart, WindowEnd, NumOfStarts, NumOfEnds, NumOfDrops); updates direction and volume field descriptions; aligns the API sample JSON to add the new fields and remove the old ones.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop! No more lone events in a row,
Now grouped by protocol, five minutes a show.
WindowStart opens, WindowEnd seals the gate,
Starts, ends, and drops — all neatly aggregate.
The docs are fresh, the schema is bright,
This bunny approves — everything's right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'updated to reflect changes around event aggregation' directly and accurately describes the main change - the MDX documentation update that shifts the traffic events schema from per-flow to grouped-window model with event aggregation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dmitri-event-aggregation

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/pages/manage/activity/traffic-events-logging.mdx

Oops! Something went wrong! :(

ESLint: 9.39.4

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from:
at JSON.stringify ()
at file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:308:45
at Array.map ()
at ConfigValidator.formatErrors (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:299:23)
at ConfigValidator.validateConfigSchema (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:330:84)
at ConfigArrayFactory._normalizeConfigData (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:676:19)
at ConfigArrayFactory._loadConfigData (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:641:21)
at ConfigArrayFactory._loadExtendedShareableConfig (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:946:21)
at ConfigArrayFactory._loadExtends (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:814:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:752:25)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/manage/activity/traffic-events-logging.mdx`:
- Line 184: The field reference documentation at line 184 lists only ICMP Type,
but the JSON sample payload at lines 240-244 includes both icmp_type and
icmp_code fields. Align these two sections by either adding ICMP Code to the
field reference list in the documentation, or remove the icmp_code field from
the JSON sample payload to match the field list. Ensure both the field reference
and the sample payload document the same event schema to provide a consistent
contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 55c952e1-8dd5-4043-89d1-8bae6dfd064d

📥 Commits

Reviewing files that changed from the base of the PR and between f83b1b6 and 4a5ed5d.

📒 Files selected for processing (1)
  • src/pages/manage/activity/traffic-events-logging.mdx

these will be the NetBird network IPs (e.g. 100.x.x.x addresses of each peer). For traffic to an external resource (like a private server or subnet), the destination might be an IP in that remote network.
* **Source and Destination Ports**: The network ports used by the connection (for TCP/UDP flows).
* **ICMP Code and Type**: For ICMP traffic, the ICMP code and type.
* **ICMP Type**: The ICMP type for grouped ICMP traffic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Align the ICMP schema between the field list and the JSON sample.

The field reference now documents only ICMP Type, but the sample payload still includes icmp_code. That presents two different contracts for the same event shape.

Suggested alignment (if ICMP code is no longer part of the model)
-    "icmp_code": 0,
     "icmp_type": 0,

Also applies to: 240-244

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/manage/activity/traffic-events-logging.mdx` at line 184, The field
reference documentation at line 184 lists only ICMP Type, but the JSON sample
payload at lines 240-244 includes both icmp_type and icmp_code fields. Align
these two sections by either adding ICMP Code to the field reference list in the
documentation, or remove the icmp_code field from the JSON sample payload to
match the field list. Ensure both the field reference and the sample payload
document the same event schema to provide a consistent contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant